<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
    <meta name="author" content="王佳佳">
    <link rel="stylesheet" href="animate.css">
    <title></title>
    <style>
        *
        {
            box-sizing: border-box;
        }
        body
        {
            margin: 0;
        }


        /* fairy:精灵 */
        .fairy
        {
            display: inline-block;
            background-image: url(img/common.png);
            background-size: 238px 628px;
        }
        .fairy-1
        {
            width: 14px;
            height: 10px;
            background-position: -186px -25px;
            vertical-align: middle;
        }
        .fairy-2
        {
            width: 24px;
            height: 17px;
            background-position: -126px -385px;
            vertical-align: middle; 
        }
        .fairy-3
        {
            width: 20px;
            height: 20px;
            background-position: -65px -445px;
        }
        .fairy-4
        {
            width: 40px;
            height: 35px;
            background-position: -90px -410px;
            vertical-align: middle;
        }
        .fairy-5
        {
            width: 40px;
            height: 35px;
            background-position: -90px -410px;
            vertical-align: middle;
        }
        .fairy-6
        {
            width: 30px;
            height: 30px;
            background-position: -64px -204px;
            vertical-align: middle;
        }
        .fairy-7
        {
            width: 30px;
            height: 30px;
            background-position: -34px -204px;
            vertical-align: middle;
        }
        .fairy-8
        {
            width: 45px;
            height: 45px;
            background-position: -6px -60px;
        }
        .fairy-9
        {
            width: 47px;
            height: 45px;
            background-position: -60px -60px;
        }



        header
        {
            width: 100%;
            height: 50px;
            background-color: #10C55B;
        }
        .head
        {
            /* border: 1px solid black; */
            width: 1200px;
            height: 50px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            color: white;
        }
        .head-left div
        {
            display: inline-block;
            height: 50px;
            line-height: 50px;
            padding-left: 18px;
            padding-right: 18px;
        }
        .head-left div:hover
        {
            background-color: #01923D;
        }
        .first
        {
            background-color: #01923D;
        }
        .head-right div
        {
            display: inline-block;
            height: 50px;
            line-height: 50px;
            padding-left: 17px;
            padding-right: 17px;
        }
        .head-right div:last-child
        {
            padding: 0;
        }
        .head-right div section
        {
            width: 58px;
            height: 30px;
            line-height: 30px;
            text-align: center;
            background-color: #01923D;
            font-size: 13px;
            border-radius: 5px;
        }
        .head-right div section:hover
        {
            /* 边框阴影：水平  垂直  模糊距离  颜色 */
            box-shadow: 0 0 3px #01923D;
        }
        .head-right div a
        {
            font-size: 13px;
            text-decoration: none;
            color: #01923D;
        }



        nav
        {
            /* border: 1px solid;   */
            width: 1200px;
            margin: 20px auto;
            height: 70px;
        }
        nav .aside
        {
            /* border: 1px solid; */
            width: 900px;
            height: 70px;
            left: 0;
            display: flex;
            justify-content: space-between;
        }
        .logo
        {
            /* display: inline-block; */
            width: 158px;
            height: 68px;
        }

        .nav-right
        {
             display: inline-block; 
            /* border: 1px solid;   */
            width: 670px;
            height: 70px;
            position: relative; 
        }
        .top
        {
            border: 1px solid lightgray;
            border-radius: 5px;
            width: 670px;
            height: 50px;
            line-height: 50px;
        }
        .all
        {
            display: inline-block;
            width: 80px;
            height: 50px;
            line-height: 50px;
            text-align: center;
        }
        .sousuo
        {
            /* border-left: 1px solid lightgray; */
            display: inline-block;
            width: 510px;
            height: 30px;
            line-height: 30px;
            margin-left: -5px;
            margin-top: 2px;
        }
        .sousuo input
        {
            width: 495px;
            height: 30px;
            margin-left: 5px;
            border: none; 
            /* 取消获得焦点时显示的边框 */
            outline: none;
        }
        .button
        {
            display: inline-block;
            width: 80px;
            height: 50px;
            background-color: #15DA66;
            position: absolute;
            right: 0;
            top: 0;
            margin-left: -5px;
        }
        .button img
        {
            margin-top: 15px;
            margin-left: 30px;
        }



        .bottom
        {
             /* border: 1px solid;  */
            width: 670px;
            height: 20px;
        }
        .bottom div
        {
            display: inline-block;
            font-size: 12px;
            padding-left: 2px;
            padding-right: 5px;
        }



        .trouble
        {
            width: 100%;
            height: 320px;
            margin-top: 30px;
            background-color: black;
        }
        .trouble-first
        {
            /* border: 1px solid;  */
            width: 1200px;
            height: 320px;
            margin: 0 auto;
            position: relative;
        }
        .trouble-first ul
        { 
            width: 1200px;
            height: 320px;
            margin: 0;
            padding: 0;
            list-style: none;
        }
        .trouble-first ul li
        {

            position: absolute;
            display: none;
        }
        .trouble-first ul li.current
        {
            display: block; 
        }
        .trouble-first aside
        {
            /* border: 1px solid; */
            position: absolute;
            width: 140px;
            height: 15px;
            bottom: 10px;
            left: 535px;
            display: flex;
            justify-content: space-between;
        }
        .trouble-first aside div
        {
            width: 15px;
            height: 15px;
            background-color: gray;
            border-radius: 50%;
        }
        .trouble-first aside div.action
        {
            background-color: #01AC48;
        }
        .img-click span
        {
            width: 30px;
            height: 40px;
            line-height: 40px;
            text-align: center;
            color: white;
            background-color: rgba(0,0,0,0.2);
            position: absolute;
            top: calc(50% - 20px);
            display: none;  
            cursor: pointer;
        }
        .img-click span:hover
        {
            background-color: lightgray;
        }
        .img-click .next
        {
            right: 0;
        }
        .img-click .prev
        {
            left: 0;
        }


        .main-top
        {
            /* border: 1px solid; */
            width: 1200px;
            height: 300px;
            margin: 0 auto;
            margin-top: 20px; 

            position: relative;
        }
        .main-top .text
        {
            width: 1200px;
            height: 100px;
            line-height: 100px;
            display: flex;
            justify-content: space-between;
        }
        .main-top .text aside
        {
            /* border: 1px solid; */
            width: 610px;
            height: 100px;
            line-height: 100px;
            display: flex;
            justify-content: space-between;
        }
        .main-top .text aside section
        {
            width: 160px;
            height: 100px;
            line-height: 100px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .text aside section h2
        {
            margin: 0;
            color: gray;
        }
        .main-top .text div
        {
            /* border: 1px solid; */
            width: 70px;
            height: 100px;
            line-height: 100px;
            font-size: 15px;
            color: gray;
        }
        .main-top .image
        {
            /* border: 1px solid; */
            width: 1200px;
            height: 200px;
            display: flex;
            justify-content: space-between;
        }
        .main-top .image a
        {
            width: 290px;
            height: 200px;
            position: relative;
        }



        .main-top .image a section
        {
            position: absolute;
            width: 290px;
            height: 200px;
            background-color: #222;
            opacity: 0.7;
            top: 0;
            left: 0;
            display: none;
        }
        .main-top .image a section div
        {
            width: 210px;
            height: 120px;
            border-top: 1px solid white;
            border-bottom: 1px solid white;
            margin-left: 40px;
            margin-top: 40px;
        }
        .main-top .image p
        {
            line-height: 30px;
            text-align: center;
            color: white;
        }




        .main-bottom
        {
            /* border: 1px solid; */
            width: 1200px;
            height: 486px;
            margin: 0 auto;
            margin-top: 30px;

            position: relative;
        }
        .main-bottom .text
        {
            /* border: 1px solid; */
            width: 1200px;
            height: 100px;
            display: flex;
            justify-content: space-between;
        }
        .main-bottom .text aside:nth-child(1)
        {
            /* border: 1px solid; */
            width: 590px;
            height: 100px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .main-bottom .text aside h2
        {
            margin: 0;
            color: gray;
        }
        .haibao
        {
            width: 150px;
            height: 100px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .main-bottom .text aside:nth-child(2)
        {
            width: 70px;
            height: 100px;
            line-height: 100px;
            font-size: 15px;
            color: gray;
        }

        .main-bottom .image
        {
            width: 1200px;
            height: 386px;
            display: flex;
            justify-content: space-between;
        }



        .main-bottom .image a
        {
            position: relative;
            width: 290px;
            height: 386px;
        }
        .main-bottom .image a section
        {
            width: 290px;
            height: 386px;
            position: absolute;
            background-color: #222;
            opacity: 0.7;
            top: 0;
            left: 0;
            overflow: hidden;
            display: none;   
        }
        .main-bottom .image a section div
        {
            width: 290px;
            height: 47px;
            padding-left: 190px; 
        } 






        footer
        {
            /* border: 1px solid; */
            width: 1200px;
            height: 320px;
            margin: 20px auto; 
        }
        .foot-top
        {
            width: 1200px;
            height: 260px;
            display: flex;
            justify-content: space-between;
        }

        .foot-left 
        {
            /* border: 1px solid; */
            width: 560px;
            height: 260px;
            display: flex;
            justify-content: space-between;
            font-size: 13px;
        }
        .foot-left div
        {
            /* display: inline-block; */
            height: 260px;
            width: 130px;
            margin-top: 5px;
        } 
        
        .foot-left div section
        {
            margin-top: 5px;
            margin-left: 15px;
            color: gray;
            cursor: pointer;
        }
        .foot-left div section:hover
        {
            color: #01AC48;
        }
        .foot-left div section.blackfont
        {
            color: #222;
        }
        .foot-right
        {
            /* border: 1px solid; */
            width: 320px;
            height: 260px;
            margin-left: 50px;
        } 
        .foot-right div:nth-child(1)
        {
            color: #666666;
            font-size: 20px;
            margin-top: 20px;
            margin-bottom: 20px;
        }
        .foot-right div:nth-child(2)
        {
            color: gray;
            font-size: 17px;
            margin-bottom: 10px;
        }
        .foot-right div:nth-child(3)
        {
            color: gray;
            font-size: 17px;
            margin-bottom: 20px;
        }
        .foot-right div:nth-child(4)
        {
            width: 140px;
            height: 40px;
            line-height: 40px;
            text-align: center;
            border-radius: 5px;
            background-color: #15DA66;
            color: white;
        }
        .foot-bottom
        {
            /* border: 1px solid;  */
            width: 1200px;
            height: 60px;
            display: flex;
            justify-content: space-between;
            font-size: 13px;
            color: gray;
        }  
        .bottom-left
        {
            /* border: 1px solid;  */
            width: 600px;
            height: 60px;
            line-height: 60px;
        }
        .bottom-left div
        {
            display: inline-block;
            margin-left: 10px;
            cursor: pointer;
        }
        .bottom-left div:hover
        {
            color: #15DA66;
        }
        .bottom-right
        {
            /* border: 1px solid;  */
            width: 600px;
            height: 60px;
            line-height: 60px;
            padding-left: 80px;
        }
    </style>
</head>
<body>
    <header>
        <section class="head">
            <aside class="head-left">
                <div class="first">首页</div>
                <div>所有分类
                    <img class="fairy fairy-1" src="" alt="">
                </div>
                <div>设计创意</div>
                <div>办公创意</div>
                <div>...</div>
            </aside>
            <aside class="head-right">
                <div>
                    <img class="fairy fairy-2" src="" alt="">
                    VIP中心
                </div>
                <div><section>请登录</section></div>
                <div><a href="">免费注册</a></div>
            </aside>
        </section>
    </header>

    <nav>
      <aside class="aside">
            <img class="logo" src="img/1.png" alt="">
            <section class="nav-right">
              <aside class="top">
                <div class="all">
                    全站
                    <img class="fairy fairy-1" src="" alt="">
                </div>
                <div class="sousuo">
                    <input type="text" name="" placeholder="800万免费设计素材任意下载">
                </div>
                <aside class="button">
                    <img class="fairy fairy-3" src="" alt="">
                </aside>
              </aside> 

              <aside class="bottom">
                <div>热门搜索 :</div>
                <div>七夕</div>
                <div>详情页</div>
                <div>icon</div>
                <div>主图</div>
                <div>秋季</div>
                <div>PPT模版</div>
                <div>EXCEL模版</div>
                <div>首页</div>
                <div>个人简历</div>
                <div>装饰画</div>
              </aside>
            </section>
      </aside>

    </nav>
    
    <section class="trouble">
        <section class="trouble-first">
            <ul>
                <li class="current"><a href=""><img src="img/banner01.jpg" alt=""></a></li>
                <li><a href=""><img src="img/banner02.jpg" alt=""></a></li>
                <li><a href=""><img src="img/banner03.jpg" alt=""></a></li>
                <li><a href=""><img src="img/banner04.jpg" alt=""></a></li>
                <li><a href=""><img src="img/banner05.jpg" alt=""></a></li>
                <li><a href=""><img src="img/banner06.jpg" alt=""></a></li>
                <li><a href=""><img src="img/banner07.jpg" alt=""></a></li>
                <li><a href=""><img src="img/banner08.jpg" alt=""></a></li>
            </ul>
            <aside class="active">
                <!-- 给小按钮添加自定义属性，令trouble的背景颜色与其属性相对应 -->
                <div class="action" data-color="#040404"></div>
                <div data-color="yellow"></div>
                <div data-color="#FDF001"></div>
                <div data-color="#2D9AFF"></div>
                <div data-color="#89DCE4"></div>
                <div data-color="#FFF8C4"></div>
                <div data-color="#100104"></div>
                <div data-color="#F4CAD8"></div>
            </aside>
            <div class="img-click">
                <span class="prev">&lt;</span>
                <span class="next">&gt;</span>
            </div>
        </section>
    </section>

    <main>
        <section class="main-top">
            <div class="text">
                <aside>
                    <section>
                    <img class="fairy fairy-4" src="" alt="">
                    <h2>精选专题</h2>
                    </section>
                    <span>100万党建素材、PPT汇报模板无限下载，每天仅需0.18元立享VIP特权</span>
                </aside>
                <div>
                    更多 >>
                </div>
            </div>
            <div class="image">
                <a href=""><img src="img/jxzt01.jpg" alt="">
                    <section>
                        <div class="animated fadeInUp">
                            <p class="p1">和啤酒有关</p>
                            <p>啤酒是如何拯救世界的</p>
                        </div>
                    </section>
                </a>
                <a href=""><img src="img/jxzt02.jpg" alt="">
                    <section>
                        <div class="animated fadeInUp">
                            <p class="p1">爱的元素背景</p>
                            <p>七夕到，让爱在土里发芽</p>
                        </div>
                    </section>
                </a>
                <a href=""><img src="img/jxzt03.jpg" alt="">
                    <section>
                        <div class="animated fadeInUp">
                            <p>鲜花背景精选</p>
                            <p>让你的设计锦上添花</p>
                        </div>
                    </section>
                </a>
                <a href=""><img src="img/jxzt04.jpg" alt="">
                    <section>
                        <div class="animated fadeInUp">
                            <p>枫叶元素背景精选</p>
                            <p>一叶而知千秋</p>
                        </div>
                    </section>
                </a>
            </div>


        </section>
        <section class="main-bottom">
            <aside class="text">
                <aside>
                    <div class="haibao">
                        <img class="fairy fairy-5" src="" alt="">
                        <h2>商用海报</h2>
                    </div>
                    <div>招聘海报</div>
                    <div>配图海报</div>
                    <div>企业文化</div>
                    <div>促销海报</div>
                    <div>原创插画</div>
                </aside>
                <aside>
                    更多 >>
                </aside>
            </aside>
            <aside class="image">
                <a href=""><img src="img/syhb01.jpg" alt="">
                    <section>
                        <div class="animated fadeInDown">
                            <img class="fairy fairy-8" src="" alt="">
                            <img class="fairy fairy-9" src="" alt="">
                        </div>
                    </section>
                </a>
                <a href=""><img src="img/syhb02.jpg" alt="">
                    <section>
                        <div class="animated fadeInDown">
                            <img class="fairy fairy-8" src="" alt="">
                            <img class="fairy fairy-9" src="" alt="">
                        </div>
                    </section>
                </a>
                <a href=""><img src="img/syhb03.jpg" alt="">
                    <section>
                        <div class="animated fadeInDown">
                            <img class="fairy fairy-8" src="" alt="">
                            <img class="fairy fairy-9" src="" alt="">
                        </div>
                    </section>
                </a>
                <a href=""><img src="img/syhb04.jpg" alt="">
                    <section>
                        <div class="animated fadeInDown">
                            <img class="fairy fairy-8" src="" alt="">
                            <img class="fairy fairy-9" src="" alt="">
                        </div>
                    </section>
                </a>
            </aside>
        </section>
    </main>

    <footer>
        <section class="foot-top">
            <aside class="foot-left">
                <div>
                        <section class="blackfont">常见问题</section>
                        <section>成为特邀设计师</section>
                        <section>成为原创贡献者</section>
                        <section>注册登录</section>
                        <section>帐号/密码</section>
                        <section>充值/售后</section>
                        <section>版权投诉</section>
                </div>
                <div>
                        <section class="blackfont">关于千图网</section>
                        <section>关于我们</section>
                        <section>媒体报道</section>
                        <section>加入我们</section>
                        <section>心系千图</section>
                        <section>每日最新</section>
                </div>
                <div>
                        <section class="blackfont">产品服务</section>
                        <section>官方博客</section>
                        <section>帮助中心</section>
                        <section>千图导航</section>
                </div>
                <div>
                        <section class="blackfont">友情链接</section>
                        <section>我图网</section>
                        <section>千库网</section>
                        <section>摄图网</section>
                        <section>包图网</section>
                        <section>视达网</section>
                        <section>更多>></section>
                </div>
            </aside>
            <aside class="foot-right">
                <div>客服咨询</div>
                <div>400-998-7011 （9:00-18:00）</div>
                <div>feedback@58pic.com</div>
                <div>点我交谈</div>
            </aside>
        </section>
        <section class="foot-bottom">
            <aside class="bottom-left">
                <div>
                    <img class="fairy fairy-6" src="" alt="">
                </div>
                <div>
                    <img class="fairy fairy-7" src="" alt="">
                </div>
                <div>注册声明</div>
                <div>版权声明</div>
                <div>售后服务</div>
            </aside>
            <aside class="bottom-right">
                Copyright ©2013-2017 千图网 沪ICP备10011451号-6上海工商 安全实名验证 信用网站
            </aside>
        </section>
    </footer>

</body>
</html>

<script>



    window.onload = function()
    {
        //搜索框
        var button = document.querySelector('.sousuo input');
        var box = document.querySelector('.top');
        // onfocus 输入框获得焦点
        button.onfocus = function()
        {
            box.style.borderColor = '#10C55B';
        }
        // onblur 输入框失去焦点
        button.onblur = function()
        {
            box.style.borderColor = 'lightgray';
        }



 //轮播图
        var lis = document.querySelectorAll('li');
        var actions = document.querySelectorAll('.active div');
        var prev = document.querySelector('.prev');
        var next = document.querySelector('.next');
        var trouble = document.querySelector('.trouble');
        var troublefirst = document.querySelector('.trouble-first');

        var index = 0; //记录当前的索引值

        //上一张
        function prevImg()
        {
            index =  index==0 ? index=lis.length-1 : index - 1;
            showImg();
        }
        //下一张
        function nextImg()
        {
            index =  index==lis.length-1 ? 0 : index + 1;
            showImg();
        }
        //展示图片
        function showImg()
        {
            for(var i = 0; i < lis.length; i++)
            {
                lis[i].className = '';
                actions[i].className = '';
            }
            lis[index].className = 'current';
            actions[index].className = 'action';
            trouble.style.backgroundColor = actions[index].dataset.color;
        }
        //自动切换图片
        var timer = setInterval(nextImg,1500);
        //图片依据指示灯切换
        for(var i = 0; i < actions.length; i++)
        {
            actions[i].index = i;
            actions[i].onmouseover = function()
            {
                clearInterval(timer);
                //根据鼠标选中的指示灯的索引切换图片
                index = this.index
                showImg();
            }
            actions[i].onmouseout = function()
            {
                if(timer) return;
                timer = setInterval(showImg,1500);
            }
        }
        //
        troublefirst.onmouseover = function()
        {
            clearInterval(timer);
            timer = null;
            prev.style.display = 'block';
            next.style.display = 'block';
        }
        troublefirst.onmouseout = function()
        {
            if(timer) return;
            timer = setInterval(nextImg,1500);
            prev.style.display = 'none';
            next.style.display = 'none';
        }
        //点击切换上一张图片
        prev.onclick = function()
        {
            prevImg();
        }
        //点击切换下一张图片
        next.onclick = function()
        {
            nextImg();
        }





        //动画
        var flashbuttons = document.querySelectorAll('.main-top .image a');
        console.dir(flashbuttons);
        var flashs = document.querySelectorAll('.main-top .image a section');
        for(var i = 0; i < flashbuttons.length; i++)
        {
            
            flashbuttons[i].index = i;
            flashbuttons[i].onmouseover = function()
            {
                flashs[this.index].style.display = 'block';
            }
            flashbuttons[i].onmouseout = function()
            {
                flashs[this.index].style.display = 'none';
            }
        }


        var flashbutton2s = document.querySelectorAll('.main-bottom .image a');
        console.dir(flashbutton2s);
        var flash2s = document.querySelectorAll('.main-bottom .image a section');
        for(var i = 0; i < flashbutton2s.length; i++)
        {
            
            flashbutton2s[i].index = i;
            flashbutton2s[i].onmouseover = function()
            {
                flash2s[this.index].style.display = 'block';
            }
            flashbutton2s[i].onmouseout = function()
            {
                flash2s[this.index].style.display = 'none';
            }
        }
    }
</script>

